#include <cstdio>

int main() {
    int sum[6] = {0};
    int N, tmp, x = -1, count = 0;
    bool flag[6] = {false};
    
    scanf("%d", &N);
    for (int i = 0; i < N; i++) {
        scanf("%d", &tmp);
        if (tmp % 5 == 0 && tmp % 2 == 0) {
            sum[0] += tmp;
            flag[0] = true;
        } else if (tmp % 5 == 1) {
            x *= -1;
            sum[1] += x * tmp;
            flag[1] = true;
        } else if (tmp % 5 == 2) {
            sum[2]++;
            flag[2] = true;
        } else if (tmp % 5 == 3) {
            sum[3] += tmp;
            count++;
            flag[3] = true;
        } else if (tmp % 5 == 4) {
            if (sum[4] < tmp) {
                sum[4] = tmp;
            }
            flag[4] = true;
        }
    }

    for (int i = 0; i < 5; i++) {
        if (flag[i]) {
            if (i == 3) {
                printf("%.1f ", sum[i] / (double)count);
            } else {
                printf("%d%c", sum[i], i==4?'\n': ' ');
            }
        } else {
            printf("N%c", i==4?'\n': ' ');
        }
    }

    return 0;
}